package cdu.bbs.bbsv2.service;

import cdu.bbs.bbsv2.domain.Topic;
import cdu.bbs.bbsv2.domain.User;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

public interface TopicService {
    List<Topic> getTopics();

    // 分页获取未置顶的帖子
    PageInfo<Topic> getNotTop(int pageNum, int pageSize);

    PageInfo<Topic> getTopics(int pageNum, int pageSize);
    //分页获取所有帖子
    PageInfo<Topic> getTopicsByUserId(int pageNum, int pageSize,String userId);

    PageInfo<Topic> getCollectionTopicsByUserId(int pageNum, int pageSize,String userId);

    List<Topic> getTopicsByUserId(String userId);
    Boolean deleteTopicById(String id);

    Boolean addTopic(Topic topic);


    List<Topic> getTopicsByCondition(Map<String, String> conditions);

    Topic getTopicById(String id);

    boolean updateInfo(Topic topic);

    int getUserThumbCount(List<Topic> topic);

    int geUserCollectionCount(List<Topic> topic);

    int getUserTopicCount(List<Topic> topic);


    Map<Topic, User> getTopTopicAndUser();







    Boolean top(String id);

    Boolean essence(String id);

    Boolean deleteTopicByIds(String[] ids);

    Boolean topTopicByIds(String[] ids);

    boolean insertTopicCollection(String topicId,String userId);
    Boolean removeTopicCollection(String topicId, String userId);

    boolean insertTopicThumb(String topicId,String userId);
    Boolean removeTopicThumb(String topicId, String userId);

    PageInfo<Topic> getThumbTopicsByUserId(int pageNum, int pageSize, String id);
}
